import request from '@/utils/request'

/**
 * 创建订单（预约教员）
 */
export function createOrder(data) {
  return request.post('/order/create', data)
}

/**
 * 获取我的订单列表
 */
export function getMyOrders(params) {
  return request.get('/order/my-list', params)
}

/**
 * 获取订单详情
 */
export function getOrderDetail(id) {
  return request.get(`/order/${id}`)
}

/**
 * 取消订单
 */
export function cancelOrder(id, reason) {
  return request.post(`/order/${id}/cancel?reason=${encodeURIComponent(reason)}`)
}

/**
 * 支付订单
 */
export function payOrder(id) {
  return request.post(`/order/${id}/pay`)
}

